home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / TEXTVALU.XS_ / textvalu.xsl
Encoding:
Extensible Markup Language  |  2003-02-21  |  2.7 KB  |  52 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->
  4.  
  5. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  6. <xsl:output encoding="utf-16" omit-xml-declaration ="yes"/>
  7.  
  8. <xsl:template match="/" xml:space="preserve">
  9. <xsl:apply-templates select="//INSTANCE"/>
  10. </xsl:template>
  11. <xsl:template match="INSTANCE" xml:space="preserve">
  12. <xsl:apply-templates select="PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE"/>
  13. </xsl:template>
  14. <xsl:template match="PROPERTY" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE"><xsl:with-param name="type"><xsl:value-of select="@TYPE"/></xsl:with-param></xsl:apply-templates>
  15. </xsl:template>
  16. <xsl:template match="PROPERTY.ARRAY" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE.ARRAY"><xsl:with-param name="includequotes">true</xsl:with-param><xsl:with-param name="type"><xsl:value-of select="@TYPE"/></xsl:with-param></xsl:apply-templates>
  17. </xsl:template>
  18. <xsl:template match="PROPERTY.REFERENCE" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE.REFERENCE"></xsl:apply-templates>
  19. </xsl:template>
  20.  
  21. <xsl:template match="VALUE.REFERENCE">"<xsl:apply-templates select="INSTANCEPATH/NAMESPACEPATH"/><xsl:apply-templates select="INSTANCEPATH/INSTANCENAME|INSTANCENAME"/>"</xsl:template>
  22.  
  23. <xsl:template match="NAMESPACEPATH">\\<xsl:value-of select="HOST/text()"/><xsl:for-each select="LOCALNAMESPACEPATH/NAMESPACE">\<xsl:value-of select="@NAME"/></xsl:for-each>:</xsl:template>
  24.  
  25. <xsl:template match="INSTANCENAME"><xsl:value-of select="@CLASSNAME"/><xsl:for-each select="KEYBINDING"><xsl:if test="position()=1">.</xsl:if><xsl:value-of select="@NAME"/>="<xsl:value-of select="KEYVALUE/text()"/>"<xsl:if test="position()!=last()">,</xsl:if></xsl:for-each></xsl:template>
  26.  
  27. <xsl:template match="VALUE.ARRAY"><xsl:param name="type"/>{<xsl:for-each select="VALUE">
  28.         <xsl:apply-templates select=".">
  29.             <xsl:with-param name="type">
  30.                 <xsl:value-of select="$type"/>
  31.             </xsl:with-param>
  32.             <xsl:with-param name="includequotes">true</xsl:with-param>
  33.         </xsl:apply-templates>
  34.         <xsl:if test="position()!=last()">,</xsl:if>
  35. </xsl:for-each>}</xsl:template>
  36.  
  37. <xsl:template match="VALUE">
  38.     <xsl:param name="type"/>
  39.     <xsl:param name="includequotes"/>
  40.     <xsl:choose>
  41.         <xsl:when test="$type='string'">
  42.             <xsl:if test="$includequotes='true'">"</xsl:if><xsl:value-of select="."/><xsl:if test="$includequotes='true'">"</xsl:if>
  43.         </xsl:when>
  44.         <xsl:when test="$type='char16'">
  45.             '<xsl:value-of select="."/>'
  46.         </xsl:when>
  47.         <xsl:otherwise>
  48.             <xsl:value-of select="."/>
  49.         </xsl:otherwise>
  50.     </xsl:choose>
  51. </xsl:template>
  52. </xsl:stylesheet>